package com.spa.infrastructure.enums.dict.rule;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "ruleKpiCondition", desc = "规则指标条件")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum RuleKpiConditionEnum {

    $gt("gt", "大于",1,0),

    ;

    private String code;
    private String desc;
    //排序
    private Integer sort;
    //状态  0 启用  1 不启用
    private Integer status;

    public static RuleKpiConditionEnum byCode(String code) {
        for (RuleKpiConditionEnum value : values()) {
            if (value.code.equals(code)) return value;
        }
        return null;
    }
}
